package ooday03;

public class Test {
    public static void main(String[] args) {
        /*
        Dog dog = new Dog("小红",4,"红");
        System.out.println(dog.name);
        dog = null;
        System.out.println(dog.name);

         */


        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("小黑", 1, "黑");
        dogs[1] = new Dog("小白", 2, "白");
        dogs[2] = new Dog("小灰", 3, "灰");
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }

        Chick[] chicks = new Chick[3];
        chicks[0] = new Chick("坤坤", 1, "黄");
        chicks[1] = new Chick("只因", 2, "黑");
        chicks[2] = new Chick("鸡哥", 3, "白");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].eat();
        }

        Fish[] fish = new Fish[3];
        fish[0] = new Fish("金金", 5, "金");
        fish[1] = new Fish("黄黄", 2, "黄");
        fish[2] = new Fish("粉粉", 6, "粉");
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].eat();
        }



        /*
        Dog dog = new Dog("小黑",1,"黑");

        dog.drink();
        dog.eat();
        dog.lookHome();

        Chick chick = new Chick("坤坤",2,"黄");
        chick.eat();
        chick.drink();
        chick.layEggs();

        Fish fish = new Fish("金金",3,"银");
        fish.eat();
        fish.drink();

         */
        /*
        Dog dog = new Dog("小黑", 1, "黑");

        dog.drink();
        dog.eat();
        dog.lookHome();
        dog.swim();

        Chick chick = new Chick("坤坤", 2, "黄");
        chick.eat();
        chick.drink();
        chick.layEggs();

        Fish fish = new Fish("金金", 3, "银");
        fish.eat();
        fish.drink();
        fish.swim();

         */

    }
}
